import Link from "next/link";
import Head from "next/head";
import { useCallback } from "react";
import axios from "axios";
function Home(){
    const click = useCallback(()=>{
        axios.get('/dataapi/data.php?id=1').then((res)=>{
            console.log(5444,res)
        })
    },[])
    return (
        <>
            <Head>
                <title>新标题</title>
            </Head>
            <button onClick={click}>获取api中的数据</button>
            <ul>
                <li>
                    <Link target="_blank" href="/post/abc">
                        <div>Go to pages/post/[pid].js</div>
                    </Link>
                </li>
                <li>
                    <Link target="_blank" href="/post/abc?foo=bar">
                        <div>Also goes to pages/post/[pid].js</div>
                    </Link>
                </li>
                <li>
                    <Link target="_blank" href="/post/abc/a-comment">
                        <div>Go to pages/post/[pid]/[comment].js</div>
                    </Link>
                </li>
            </ul>
        </>
    )
}
export default Home